import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
	
	state:{
		order_type:'',
		categoryid_one:'',
		categoryid_two:'',
		category_name:'',
		serve_type:'',
		fittings_status:'',
		images:[],
		number:'',
		name:'',
		mobile:'',
		province:'',
		city:'',
		address:'',
		area:'',
		servetime:'',
		coupon_id:0,
		longitude:'',
		latitude:'',
		userprice:'',
		orderprice:'',
		pic:''
	},
	mutations:{
		changeData(state,p){
			state.order_type=p.order_type
			state.categoryid_one=p.categoryid_one
			state.categoryid_two=p.categoryid_two
			state.category_name=p.category_name
			state.serve_type=p.serve_type
			state.fittings_status=p.fittings_status
			state.images=p.images
			state.number=p.number
			state.remarks=p.remarks
			state.longitude=p.longitude
			state.latitude=p.latitude
			state.orderprice=p.userprice
			uni.setStorageSync('money',p.userprice)
			state.pic=p.pic
		},
		changedata1(state,p){
			state.name=p.name
			state.mobile=p.mobile
			state.province=p.province
			state.city=p.city
			state.address=p.address
			state.servetime=p.servetime
			state.area=p.area
		}
	}
	
})

export default store